<div class="common_form">
	<table cellpadding="0">
		<tbody>
			<tr>
				<td>
					<?php $this->widget('ext.autowidget');?>
					<input type="text" class="autokey" id='search' size="90"/>
					&nbsp;&nbsp;
					<input type="button" class="default_btn" id='submit'  value="搜索"/>
				</td>
			</tr>

			<tr>
				<td>
					<div id="speciallist"></div>
				</td>
			</tr>
		</tbody>
	</table>
</div>
<script type="text/javascript">
	var iframe_name = $('#right_main',parent.document).attr('name');
	var sValue=parent.frames[iframe_name].getInput();
	var str="";
	if(sValue.length>0){
		$("#search").val(sValue);
		$.getJSON("/admin/ubutton/ubutton/getspecial?keyword="+encodeURIComponent(sValue)+"",function(data){
			for(var i in data){
				if(data[i]['type']==1){
					str+='<input type="checkbox" value="'+data[i]['url']+'" name="'+data[i]['type']+'" id="'+data[i]['name']+'" checked> <a href="'+data[i]['url']+'" target="_blank">'+data[i]['name']+'--<span style="color:#f60;">专题</span></a><br/>';
				}else if(data[i]['type']==2){
					str+='<input type="checkbox" value="'+data[i]['url']+'" name="'+data[i]['type']+'" id="'+data[i]['name']+'" checked> <a href="'+data[i]['url']+'" target="_blank">'+data[i]['name']+'--<span style="color:#f60;">论坛</span></a><br/>';
				}else if(data[i]['type']==3){
					str+='<input type="checkbox" value="'+data[i]['id']+'" name="'+data[i]['type']+'" id="'+data[i]['id']+'" checked> '+data[i]['name']+'--<span style="color:#f60;">商城</span><br/>';
				}else if(data[i]['type']==4){
					str+='<input type="checkbox" value="'+data[i]['id']+'" name="'+data[i]['type']+'" id="'+data[i]['id']+'" checked> '+data[i]['name']+'--<span style="color:#f60;">共享</span><br/>';
				}
			}
			if(parseInt(data)==0) $("#speciallist").html("<div style='width:200px;height:100px;line-height:100px; font-weight:bold;font-size:20px;color:#F00;margin:0 auto;'>没有找到相关内容</div>");
			else $("#speciallist").html(str);
		});
	}
	$("#submit").bind("click",function(){
		var value=$.trim($("#search").val());
		var str="";
		var result="";
		if(value.length==0) alert("请输入相关专题！");
		else{
			$.getJSON("/admin/ubutton/ubutton/getspecial?keyword="+encodeURIComponent(value)+"",function(data){
				for(var i=0;i<data.length;i++){
					if(data[i]['type']==1){
						str+='<input type="checkbox" value="'+data[i]['url']+'" name="'+data[i]['type']+'" id="'+data[i]['name']+'"> <a href="'+data[i]['url']+'" target="_blank">'+data[i]['name']+'--<span style="color:#f60;">专题</span></a><br/>';
					}else if(data[i]['type']==2){
						str+='<input type="checkbox" value="'+data[i]['url']+'" name="'+data[i]['type']+'" id="'+data[i]['name']+'"> <a href="'+data[i]['url']+'" target="_blank">'+data[i]['name']+'--<span style="color:#f60;">论坛</span></a><br/>';
					}else if(data[i]['type']==3){
						str+='<input type="checkbox" value="'+data[i]['id']+'" name="'+data[i]['type']+'" id="'+data[i]['id']+'"> '+data[i]['name']+'--<span style="color:#f60;">商城</span><br/>';
					}else if(data[i]['type']==4){
						str+='<input type="checkbox" value="'+data[i]['id']+'" name="'+data[i]['type']+'" id="'+data[i]['id']+'"> '+data[i]['name']+'--<span style="color:#f60;">共享</span><br/>';
					}
				}
				if(parseInt(data)==0) $("#speciallist").html("<div style='width:200px;height:100px;line-height:100px;font-weight:bold;font-size:20px;color:#F00;margin:0 auto;'>没有找到相关专题</div>");
				else $("#speciallist").html(str);
			});
		}
	});
</script>